﻿using System;
using RssReaderTemplate.Repositories;
using RssReaderTemplate.Model;

namespace RssReaderTemplate.ViewModels
{
    public static class ViewModelCollection
    {
        private static readonly string _rssUrl = "$TemplateRssUrl$";
        private static RssRepository _repository;

        static ViewModelCollection()
        {
            _repository = new RssRepository(_rssUrl, new NetworkMonitor());
            _repository.Connect();
        }

        public static ListViewModel ListViewModel
        {
            get
            {
                return new ListViewModel(_repository);
            }
        }

        public static CategoriesViewModel CategoriesViewModel
        {
            get { return new CategoriesViewModel(_repository); }
        }


        public static DetailsViewModel DetailsViewModel(Guid id, int index)
        {
            return new DetailsViewModel(_repository,id, index);
        }
    }
}
